import type { PDataRes } from "@/api/response";
import { http } from "@/utils/http";

export type ScanOption = {
  dir: string; // 目录路径
  exts: string[]; // 扩展名
  excludeDirs: string[]; // 排除目录
  ignoreHidden: boolean; // 忽略隐藏文件
};

// 扫描本地目录
export const scanLocalDir = (option: ScanOption): Promise<PDataRes> => {
  return http.post("/api/v1/assets/scan/local", { data: option });
};

// 获取扫描本地目录状态
export const getScanLocalState = (): Promise<PDataRes> => {
  return http.get("/api/v1/assets/scan/local/state");
};
